UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yfriAHlKzveH03CWfHdyD9/ZRtY1x66yAYppxa2uXLo='
WHERE
key_id = '039546d5b37d1aaba5035a621d7bb9e845dd2b52472fa744ed5d4e41799d6631'
AND (
token = 'yfriAHlKzveH03CWfHdyD9/ZRtY1x66yAYppxa2uXLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)