UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm9SfkZAR/pVzKq4XztjWPJIA6ybjKQMpMW4XqFD7cIE=' 
WHERE 
  key_id = '322a48276c5590c5a1fbd60eb34895ae13a9ba274e6fa273e0d24c8dbb6d15d2' 
  AND (
    token = 'm9SfkZAR/pVzKq4XztjWPJIA6ybjKQMpMW4XqFD7cIE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023