UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1E4eDhmNwh2cTy5lQ4h0iyVX5E99Rd819xpDyBYwMLM='
WHERE
key_id = 'eac56f93910a5a14fb80eda3b6ffb81ff27cf217d3757a7fce5653ca4d61606c'
AND (
token = '1E4eDhmNwh2cTy5lQ4h0iyVX5E99Rd819xpDyBYwMLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)