UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EIkHERT4AivN068dsgHdNQbGnbe4PBvwcr96ujtSj8o='
WHERE
key_id = 'e55af034bd6cd412d2eb0579de0bcec1e6142e7381b855ea7960aeeb31f1acca'
AND (
token = 'EIkHERT4AivN068dsgHdNQbGnbe4PBvwcr96ujtSj8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)