UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CrwNX3a3x0E+QoZG8wTjUKETee1ZkclAPq1Zw166BlM='
WHERE
key_id = '72688192e8013db664f171934fa5774fc434bb0a13403f3a7a9dcd919e19dc0e'
AND (
token = 'CrwNX3a3x0E+QoZG8wTjUKETee1ZkclAPq1Zw166BlM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)