UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HIqJwmObV0YfrDRud07N2ElzW4+Pt5KQbMik5TwABl4='
WHERE
key_id = '1bfef30cba1c617492ee668a19c49a88cb5b40d705be53514ffb5b7b51cd4f2c'
AND (
token = 'HIqJwmObV0YfrDRud07N2ElzW4+Pt5KQbMik5TwABl4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)