UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mGTFmMnsbJEYTKMWejUwquz0xm8CaBXPzGuL/UKr7E8='
WHERE
key_id = '5bcb5720109119b50815cf6023cd3c37ad10e29c20537aa4028c989258e76cc0'
AND (
token = 'mGTFmMnsbJEYTKMWejUwquz0xm8CaBXPzGuL/UKr7E8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)