UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VPY412ZocKl8ktughnaF38zfmXHOAuPedC2Wbp5qAf0='
WHERE
key_id = '4b243131f8fb0d2e1b7657a7fd403bfe7c549f354eba716ad0c937a74a8927f4'
AND (
token = 'VPY412ZocKl8ktughnaF38zfmXHOAuPedC2Wbp5qAf0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)