UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7C5tfJuBOf+Tahl4NUdAA955pr7qKrb+rq+zUVx+b2k='
WHERE
key_id = 'e71e13526e067266824b93be65ff777b4e0ef0e2f6d1b127deed868c6b5e3cf1'
AND (
token = '7C5tfJuBOf+Tahl4NUdAA955pr7qKrb+rq+zUVx+b2k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)