UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pDkoB8gGcmcy4lL40pnrRnKE8W1INpNS/BhFwk3OhJo='
WHERE
key_id = '43f0383073ca7ddf40476f3612c381fd532e18ea80515eb266b6a18e6df718f8'
AND (
token = 'pDkoB8gGcmcy4lL40pnrRnKE8W1INpNS/BhFwk3OhJo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)