UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lOAtZ09SPraw6XfeFemaOkFt2w6eIWa4/IfKJWb3v/U='
WHERE
key_id = 'e9f985ad78769a15c495df4ee8cec26080366e843d2941d6211fbb7cb39496a0'
AND (
token = 'lOAtZ09SPraw6XfeFemaOkFt2w6eIWa4/IfKJWb3v/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)