UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y/HjQoawZeaDFYLkdkc1XVvDSt85EjfQSvMkmhnt5T8='
WHERE
key_id = 'aedcf5a41e60b6f9f325d51caffd4c0c2b2d8e2c8665f1592ccd53f0565938ec'
AND (
token = 'y/HjQoawZeaDFYLkdkc1XVvDSt85EjfQSvMkmhnt5T8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)