UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vbb0JtqOEj43PKbudKKFz9ALHw24nhQOnWdA/gWkOt4=' 
WHERE 
  key_id = '24281bdbf76649ecc729ec8a370a27a0ba9b52e9018914b4f476141b3345564c' 
  AND (
    token = 'vbb0JtqOEj43PKbudKKFz9ALHw24nhQOnWdA/gWkOt4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030