UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wW9k2hEHCZJ83JCdMxSMSwoQElkt6RejMBmU5Uzbimw=' 
WHERE 
  key_id = '6672a4a100fefdd7e6e4c6e31fb61291ee3b5e1a6496d2fda871fb8171b18529' 
  AND (
    token = 'wW9k2hEHCZJ83JCdMxSMSwoQElkt6RejMBmU5Uzbimw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068