UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8DYgFzjMGkqmtFrPmcNvEeMtT4mwnlz5AwOCJgxTsGQ='
WHERE
key_id = 'bdf78fd939fa6ddbdb85e6c29acb2f455cb7f872a00d60ecb8fdaa77695da2a5'
AND (
token = '8DYgFzjMGkqmtFrPmcNvEeMtT4mwnlz5AwOCJgxTsGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)