UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/8n1XaMaUy4gITQgi4SjHwuXIbSF48WBS/A/Syzg2qw='
WHERE
key_id = 'b438296d5c04a54e3ea6c91b70f84a824007c0a388bce84c66882fa13c8f50cc'
AND (
token = '/8n1XaMaUy4gITQgi4SjHwuXIbSF48WBS/A/Syzg2qw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)