UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nlLcGzJqZRGwYSGldQO7P9Oopj42Q7uAVDhAQVQ8rDM='
WHERE
key_id = '4a5756a787054908390c2190ee922526b8f903233206d18189b08f55aad9a787'
AND (
token = 'nlLcGzJqZRGwYSGldQO7P9Oopj42Q7uAVDhAQVQ8rDM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)