UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HsV/sd5+y8DHScQn3RQ/ffZ/ctRuX+4YCe1hDexqq1s='
WHERE
key_id = 'c61d7943313ec8ba23f9752fee4d338d130588488c220c28228509184c242386'
AND (
token = 'HsV/sd5+y8DHScQn3RQ/ffZ/ctRuX+4YCe1hDexqq1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)