UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's4pM4OhQyfdLBz4qWd+OxSnS3jdvof3NSR4O2yECRrQ='
WHERE
key_id = '188ded2014a46a6fd2151f17abeb9d3b786c691e1ccb82121b3725d4f962010c'
AND (
token = 's4pM4OhQyfdLBz4qWd+OxSnS3jdvof3NSR4O2yECRrQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)