UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fYwtDJ2AvE/ZbOZhimVEg+atnQZWjtPB9tJGtN2lF1Y='
WHERE
key_id = 'bd8a062dcffff3364d2b1910cb3eff841021ca8faefc96fd4b3650423caf3719'
AND (
token = 'fYwtDJ2AvE/ZbOZhimVEg+atnQZWjtPB9tJGtN2lF1Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)