UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NHFo64mJEud1Is3l40eiZ5Ipo9babV37FGQ4H3ffK8o='
WHERE
key_id = '4ce2debe77eb38a7ca144a119b294acdeac58874967ed999666a36384b5333e0'
AND (
token = 'NHFo64mJEud1Is3l40eiZ5Ipo9babV37FGQ4H3ffK8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)