UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MGfYdBXqlj06HLGJdTb+e7SeqZ71tzd/skqDnxLw7tE=' 
WHERE 
  key_id = '704d31e90e54978de2a5ba4bd9c606bdb505843bb7405bf36dd3d99eea2ae3c3' 
  AND (
    token = 'MGfYdBXqlj06HLGJdTb+e7SeqZ71tzd/skqDnxLw7tE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049