UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IrOQsQRna0uFax7C+EY84YXmzHdd3MFXD3CQNHpClPo='
WHERE
key_id = '01e25c8bffd4a95aa5c85cfc7c7f556a55b456d023eecc013d82884ba5506b2e'
AND (
token = 'IrOQsQRna0uFax7C+EY84YXmzHdd3MFXD3CQNHpClPo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)