UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GpJ903tLNBNdOK+7ZApAF3nFHWJomivNZ0VfKuThyd4='
WHERE
key_id = 'fc5362e22df79cbb81b477104dab336da0d4f6ba6c61d45a946cd55d844cc887'
AND (
token = 'GpJ903tLNBNdOK+7ZApAF3nFHWJomivNZ0VfKuThyd4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)