UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DdQiyPFfqX/VXRaBfZkxcfxgZEvGXrk52b5jQ1qdzHA=' 
WHERE 
  key_id = 'acd12c7f387b97dde7ad2622d26bbb1589da86590205830dca7adbb1c0dc6271' 
  AND (
    token = 'DdQiyPFfqX/VXRaBfZkxcfxgZEvGXrk52b5jQ1qdzHA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037