UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '21Qk44XJ9xyy6MnF+1eehYKkR9pAuirW4CGveL1rNcA='
WHERE
key_id = '9f9e5e0c1a9fd3bf7235df79be18df7f6bc1ece9f3a4b36707bedabc06111d51'
AND (
token = '21Qk44XJ9xyy6MnF+1eehYKkR9pAuirW4CGveL1rNcA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)