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