UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EdSocB2PiS+LR2pu6q+FL/5UeWOLMIyh/9HzOsgPdYI=' 
WHERE 
  key_id = 'd147c36f3dffdb304df22a0d93a71b8d67b57e07247ce2ce96d9c76e8ca9ad55' 
  AND (
    token = 'EdSocB2PiS+LR2pu6q+FL/5UeWOLMIyh/9HzOsgPdYI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033