UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ghz9StOy7kRZ7P3gXYjxEGCKIvjU/IY2IH1rUtxv9mM=' 
WHERE 
  key_id = '4fcdae30bc2eb9cf3f5703ed2c860918a07ad8b93149a877fc8934eda8bf184e' 
  AND (
    token = 'Ghz9StOy7kRZ7P3gXYjxEGCKIvjU/IY2IH1rUtxv9mM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031