UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'deJubHPtUreo75kM/VzhLlWG7boNrkEfZYeJiAwkW90=' 
WHERE 
  key_id = 'e6481c1c126893c5a44fd4775fcccf7b405cce5b4373433c96e60a97cd7339c3' 
  AND (
    token = 'deJubHPtUreo75kM/VzhLlWG7boNrkEfZYeJiAwkW90=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018