UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SZJrhV5p68RPj5R0jGZt4vlWgf4Ms1J8B0/r6QRwk14='
WHERE
key_id = '0733042b3f7d667fcbedd99f718db113f9ec25d0d02e31d5a574df0d2fa4e6f2'
AND (
token = 'SZJrhV5p68RPj5R0jGZt4vlWgf4Ms1J8B0/r6QRwk14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)