UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XgbHKUq1GJGhp3NMAG1GHGV7pyRdU8aeQ9mSsth2G60='
WHERE
key_id = '75f4bf4552f2dc60f74d482add41b6125b326d3e9acbdc455e9059a6e157aecd'
AND (
token = 'XgbHKUq1GJGhp3NMAG1GHGV7pyRdU8aeQ9mSsth2G60='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)