UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PNlEVd3GD+g/WAMeD10N6pRgKAuDzi6pw9vJoMwA98E='
WHERE
key_id = '38cf0b8535931eddf7c7fb6bff2ad366d4c16d839e86d7895b69c40bae4e21e2'
AND (
token = 'PNlEVd3GD+g/WAMeD10N6pRgKAuDzi6pw9vJoMwA98E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)