UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BEl4cIXk+rj4a9svENmTr38k10AYFhojR9FGz22u6xA=' 
WHERE 
  key_id = '28314a57cf2435953d435afadb4ba422b0ff4b2abb26235054cacd83752c5f6a' 
  AND (
    token = 'BEl4cIXk+rj4a9svENmTr38k10AYFhojR9FGz22u6xA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038