UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uxrx1vic96pam3NJVDPEj7RYCVBnfJLUvbZWVgEHs6o='
WHERE
key_id = '21ac61fa95bea3567be753a6e0609416a5b2d89ede76c6ed0489d84302ba1c4c'
AND (
token = 'Uxrx1vic96pam3NJVDPEj7RYCVBnfJLUvbZWVgEHs6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)