UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mbU6BTqgjPJ8XcEGT0U1WFd7Z66eWIMJG+ecGd/XQTg='
WHERE
key_id = '341379d319bcb7e2f4540c16198f3b455908eda75490f6d1bb418a6cc198ebb7'
AND (
token = 'mbU6BTqgjPJ8XcEGT0U1WFd7Z66eWIMJG+ecGd/XQTg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)