UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uuherkL7/SdRLoYCJxjTqVJSp0TkK4duOX0+WT2N4iw='
WHERE
key_id = '55d1d102f55025435a4e27f542ccb88e17356eba9b36c977c8a6f4f0feef42ef'
AND (
token = 'uuherkL7/SdRLoYCJxjTqVJSp0TkK4duOX0+WT2N4iw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)