UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UCGHoedSZ8ahTizxQFm/nAufuER516ofcjkiAtO9zTs='
WHERE
key_id = '8e8e595d998043a0f08a6a155a0d38200afa2c6fda78ec1f7bad079c24f7b0dd'
AND (
token = 'UCGHoedSZ8ahTizxQFm/nAufuER516ofcjkiAtO9zTs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)