UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wOfmdeqoy4lDDfgTdOOdtJPloA9Wom8BR5uo4gs0p/g='
WHERE
key_id = '6cbc9d5c0deff876db0907304ac84598711d7b6823db24c289d6e5218e416331'
AND (
token = 'wOfmdeqoy4lDDfgTdOOdtJPloA9Wom8BR5uo4gs0p/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)