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