UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jz4kZ3c0JBlOqpOGarX2zSot2RkYFF0Fo3d3kt2g67c=' 
WHERE 
  key_id = '229261c54a49cb5cdb1b5efb11bf6e9839b895f5ec6a0b17132a90fb7f2381b0' 
  AND (
    token = 'jz4kZ3c0JBlOqpOGarX2zSot2RkYFF0Fo3d3kt2g67c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030