UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T4TIAZv8BvvQLt5/6SRZAjMOt4aCjAFeQnMKYO3LMlg=' 
WHERE 
  key_id = 'fe0cec6baf2f1c74ff5062a4e8ffc988396cf050de0ba46c1a1f61f1358fe948' 
  AND (
    token = 'T4TIAZv8BvvQLt5/6SRZAjMOt4aCjAFeQnMKYO3LMlg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051